import requests
from config import *

def download(url):
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36',
        'Host': 'www.bxwx9.org',
        'Referer': 'https://www.bxwx9.org/btopallvisit/0/2.htm',
        'Upgrade-Insecure-Requests':'1',
        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
        'Accept-Language': 'zh-CN,zh;q=0.9'
    }
    response = requests.get(url, headers=headers)
    return response.text

if __name__ == '__main__':
    pages = list(range(1,2))
    for page in pages:
        url = BASE_URL + str(page) + '.htm'
        # print(url)
        print(download(url))
